package com.yunkeji.config.init;

import com.yunkeji.common.utils.call.TencentRTCUtils;
import com.yunkeji.config.properties.RtcProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;

/**
 * 腾讯云语音初始化
 *
 * @author 老张
 */
@Configuration
public class RtcConfig {

    @Autowired RtcProperties rtcProperties;

    /** 生成userSign */
    @PostConstruct
    public void initUserSgin() {
        TencentRTCUtils.Trtc trtc = rtcProperties.getTrtc();
        TencentRTCUtils.Cos cos = rtcProperties.getCos();
        TencentRTCUtils.SnapCheck snapCheck = rtcProperties.getSnapCheck();
        TencentRTCUtils.Yitu yitu = rtcProperties.getYitu();

        /** 腾讯云实时语音 */
        TencentRTCUtils.initTrtc(trtc);
        // 腾讯云OSS可录音
        TencentRTCUtils.initCOS(cos);
        // 鉴黄
        TencentRTCUtils.initIacsClient(snapCheck);
        // 语音实时监测
        TencentRTCUtils.initYitu(yitu);
    }
}
